package YNU;


import YNU.View.StudentView;
import YNU.View.TeacherView;
import YNU.View.impl.StudentViewImpl;
import YNU.View.impl.TeacherViewImpl;
import YNU.po.Student;
import YNU.po.Teacher;

import java.util.Scanner;

public class TeacherEntry {


    public void work() {
        Scanner input = new Scanner(System.in);

        System.out.println("----------------------------------");
        System.out.println("|\t\t\t 成绩查询系统  \t\t\t|");
        System.out.println("----------------------------------");
//
        TeacherView teacherView = new TeacherViewImpl();
        StudentView studentView = new StudentViewImpl();
        Teacher teacher = teacherView.login();


        //登录
        if (teacher != null) {
            int menu = 0;
            while (menu != 5) {
                //输出主菜单
                System.out.println("\n1.显示所有学生成绩信息\t2.搜索学生\t3.添加学生成绩信息\t4.删除学生成绩信息\t" +
                        "5.编辑学生信息\n6.添加管理员信息\t7显示.所有管理员信息\t8.删除管理员\n其他选择:退出系统");
                System.out.println("请输入你的选择：");
                menu = input.nextInt();
                switch (menu) {
                    case 1:
                        studentView.listStudentAll();
                        break;
                    case 2:
                        studentView.listStudent();
                        break;
                    case 3:
                        studentView.saveStudent();
                        break;
                    case 4:
                        studentView.removeStudent();
                        break;
                    case 5:
                       // System.out.println("输入需要修改学生的名字和密码")；
                        Student student= studentView.login();
                        studentView.editStudent(student.getSid());
                        break;
                    case 6:
                        teacherView.saveTeacher();
                        break;
                    case 7:
                        teacherView.listTeacherAll();
                        break;
                    case 8:
                        teacherView.removeTeacher();
                        break;
                    default:
                        System.out.println("欢迎下次光临成绩查询系统");
                        break;
                }
            }

        } else {
            System.out.println("\n名称或密码输入错误!\n");
        }
        //  }

    }
    public static void main (String[]args){
        new TeacherEntry().work();
		/*
		ElmAdminEntry elmAdminEntry=new ElmAdminEntry();
		elmAdminEntry.work();*/
    }
}